<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2017/6/14
  Time: 15:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>操作记录</title>
    <style type="text/css">
      body{
        margin: 0px;
        padding: 0px;
      }
      table{
        width: 100%;
        height: 400px;
        border: #000 1px solid;
      }
      tr td{
        height: 40px;
        text-align: center;
        border: #000 1px solid;
      }

    </style>
</head>
<body>
<div style="width:150px; height: 30px; margin: 10px auto;line-height: 30px;">
  <strong>银行用户操作记录</strong>
</div>
<table>
  <tr>
    <td width="70px">流水号</td>
    <td width="90px">姓名</td>
    <td width="200px">操作日期</td>
    <td width="250px">操作记录</td>
    <td width="80px">操作方式</td>
    <td width="90px">修改</td>
    <td width="90px">删除</td>
  </tr>
  <%--循环遍历所有得到的记录并输出--%>
  <c:forEach items="${page.data}" var="record">
    <tr>
      <td width="70px">${record.nub}</td>
      <td width="90px">${record.username}</td>
      <td width="200px">${record.days}</td>
      <td width="250px">${record.business}</td>
      <td width="80px">${record.note}</td>
      <td width="90px"><a href="/update?id=${record.recordid}&pageNow=${page.pageNow}">修改</a></td>
      <td width="90px"><a href="/delete?id=${record.recordid}&pageNow=${page.pageNow}">删除</a></td>
    </tr>
  </c:forEach>
  <tr>
    <td colspan="4">
      <!-- 分页功能 start -->
      <div align="center">
        <font size="2">共 ${page.totalPageCount} 页</font> <font size="2">第
        ${page.pageNow} 页</font> <a href="/qurryAll?pageNow=1">首页</a>
        <c:choose>
          <c:when test="${page.pageNow - 1 > 0}">
            <a href="${pageContext.request.contextPath}/qurryAll?pageNow=${page.pageNow - 1}">上一页</a>
          </c:when>
          <c:when test="${page.pageNow - 1 <= 0}">
            <a href="${pageContext.request.contextPath}/qurryAll?pageNow=1">上一页</a>
          </c:when>
        </c:choose>
        <c:choose>
          <c:when test="${page.totalPageCount==0}">
            <a href="${pageContext.request.contextPath}/qurryAll?pageNow=${page.pageNow}">下一页</a>
          </c:when>
          <c:when test="${page.pageNow + 1 < page.totalPageCount}">
            <a href="${pageContext.request.contextPath}/qurryAll?pageNow=${page.pageNow + 1}">下一页</a>
          </c:when>
          <c:when test="${page.pageNow + 1 >= page.totalPageCount}">
            <a href="${pageContext.request.contextPath}/qurryAll?pageNow=${page.totalPageCount}">下一页</a>
          </c:when>
        </c:choose>
        <c:choose>
          <c:when test="${page.totalPageCount==0}">
            <a href="${pageContext.request.contextPath}/qurryAll?pageNow=${page.pageNow}">尾页</a>
          </c:when>
          <c:otherwise>
            <a href="${pageContext.request.contextPath}/qurryAll?pageNow=${page.totalPageCount}">尾页</a>
          </c:otherwise>
        </c:choose>
      </div>
      <!-- 分页功能 End -->
    </td>

    <td colspan="2">
      <div align="center">
        <form action="/search" method="post">
          <input type="text" name="search"/>
          <input type="submit" value="查询"/>
        </form>
      </div>
    </td>

    <td colspan="1">
      <a href="/add">添加用户</a>
    </td>

  </tr>
</table>
</body>
</html>
